package com.cooper.scraper;

import java.util.List;

import com.cooper.android.comm.Resource;

public interface ResourceScraper<T extends Resource> {

	public static final String BROWSE_URL_PARAM_SUBSCRIBE_PREFIX = "BROWSE_URL_PARAM_SUBSCRIBE_";

	public abstract String getId();

	public abstract ResultUrl createBrowseUrl(List<ScraperBrowseParam> params)
			throws ScraperException;

	// public abstract ResultUrl createSearchUrl(String keyword, int pageNumber)
	// throws DownloadException, ScraperException;

	public abstract List<T> extractBrowseResource(String page, String referer)
			throws ScraperException;

	public abstract List<T> extractBrowseResource(String page, String referer,
			String redirectUrl) throws ScraperException;

	// public abstract List<T> extractSearchResource(String page, String
	// referer)
	// throws DownloadException, ScraperException;
	//
	// public abstract List<T> extractSearchResource(String page, String
	// referer,
	// String redirectUrl) throws DownloadException, ScraperException;

	// public abstract int getSearchPageCount(String page)
	// throws DownloadException, ScraperException;
	//
	// public abstract int getSearchPageCount(String page, String redirectUrl)
	// throws DownloadException, ScraperException;

	public abstract ResultUrl createPageCountUrl(List<ScraperBrowseParam> params)
			throws ScraperException;

	public abstract int getBrowsePageCount(String page)
			throws ScraperException;

	public abstract int getBrowsePageCount(String page, String redirectUrl)
			throws ScraperException;

	public abstract String extractDetails(String page, String ResourceId)
			throws ScraperException;

	public abstract List<ScraperBrowseParam> getBrowseUrlParams()
			throws ScraperException;

}